#include"Material.h"

Material::Material()
{
	diffuse = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);
	spec = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);
	shiness = 1.0f;
	gloss = 1.0f;
	
	colorTex = NULL;
	normalTex = NULL;
}

void Material::SetColorTex(string filename)
{
	if(colorTex)
		SAFE_RELEASE(colorTex);
	D3DXCreateTextureFromFile(D3DDevice, filename.c_str(), &colorTex);
}

void Material::SetNormalTex(string filename)
{
	if(normalTex)
		SAFE_RELEASE(normalTex);
	D3DXCreateTextureFromFile(D3DDevice, filename.c_str(), &normalTex);
}